#include "wifi_thread.h"
#include "app_wifi.h"
#include "da16200_AT.h"
#include "app_common.h"


/* wifi_thread entry function */
/* pvParameters contains TaskHandle_t */
void wifi_thread_entry(void * pvParameters)
{
    FSP_PARAMETER_NOT_USED(pvParameters);

    /* TODO: add your own code here */
    EventBits_t event_group_bits;
	EventBits_t waiting_eg_bits;
	
	// waiting for initialing
	waiting_eg_bits = EVENT_GROUP_SET_BIT(EVENT_GROUP_0_INIT);
	event_group_bits = xEventGroupWaitBits(event_group_0,     
											waiting_eg_bits,            
											pdFALSE,             // Do not clear event bits    
											pdTRUE,              // waiting all bits setting
											portMAX_DELAY);      // waiting forever 

	// initilaize the wifi module
    Wifi_Init();

    while(1)
    {
		Wifi_RunningEntry();
    }
}
